** Table C5 district-crop

use "$data/ais_mca_final.dta", clear

label var lang_control_post "Non-state official language speakers (%) * Post"
label var hyv_share_cdt "HYV share"
* Tech adoption 
local replace replace 
foreach var in hyv_share_cdt {
	
	sum `var' if year <= 2006, d 
	local control_mean = round(`r(mean)', 0.001)
	
	reghdfe `var' lang_control_post c.share_off_speakers#i.t if mca_on_border == 1 , a(i.district_MCA_s##i.g_crop i.border_id##i.t i.g_crop##i.t c.share_sc##i.t c.literacy_rate##i.t c.TOT_P##i.t c.AC_SOC##i.t c.agri_L##i.t) cluster(district_MCA_s)

	outreg2 using "$results/tables/table_C5_panelA.tex", tex(frag) dec(3) bracket label keep(lang_control_post) addtext(Pre-Period Mean, "`control_mean'", District * Crop f.e., Yes, Border * Time f.e., Yes, Crop * Time f.e., Yes, Census Controls * Time f.e., Yes) nocons  nonotes `replace'
	
	local replace append 
	
}

** Yield 
use "$data/icrisat_mca_final.dta", clear 


label var lang_control_post "Non-state official language speakers (%) * Post"

sum yield if year <= 2007, d 
local control_mean = round(`r(mean)', 0.001)

reghdfe yield lang_control_post c.share_off_speakers#i.t if mca_on_border == 1 , a(i.district_MCA_s##i.g_crop i.border_id##i.t i.g_crop##i.t c.share_sc##i.t c.literacy_rate##i.t c.TOT_P##i.t c.AC_SOC##i.t c.agri_L##i.t) cluster(district_MCA_s)

local replace append 
outreg2 using "$results/tables/table_C5_panelA.tex", tex(frag) dec(3) bracket label keep(lang_control_post) addtext(Pre-Period Mean, "`control_mean'", District * Crop f.e., Yes, Border * Time f.e., Yes, Crop * Time f.e., Yes, Census Controls * Time f.e., Yes) nocons  nonotes `replace'
